﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Text;
using System.Reflection;

using Styx;
using Styx.Common;
using Styx.CommonBot;
using Styx.TreeSharp;
using Styx.Helpers;
using Styx.WoWInternals;
using Styx.WoWInternals.WoWObjects;
using Styx.Pathing;
using Styx.Plugins;
using Bots.Professionbuddy.Components;
using Bots.Professionbuddy;
using Bots.Professionbuddy.ComponentBase;
using Bots.Professionbuddy.Dynamic;
using Bots.Professionbuddy.PropertyGridUtilities.Converters;
using Bots.Professionbuddy.PropertyGridUtilities.Editors;


namespace DesmoPlugin
{
    

    public partial class DesmoPluginCore : HBPlugin
    {

        public override string Name { get { return "Desmo Extreme Auctioning Plugin"; } }
        public override string Author { get { return "Desmo"; } }
        public override Version Version { get { return new Version(0, 0, 8, 1); } }
        public override string ButtonText { get { return "Bot Settings"; } }
        private static LocalPlayer Me { get { return StyxWoW.Me; } }


        public override bool WantButton
        {
            get
            {
                return true;
            }
        }
        public override void OnButtonPress()
        {
            
            DesmoPlugin.DesmoPluginCFG config = new DesmoPlugin.DesmoPluginCFG();
            config.ShowDialog();
             
        }


        /// <summary>
        /// Punto di ingresso principale dell'applicazione.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new DesmoPluginCFG());
        }
        
        public void Initialize()
        {/*
            BuyItemFromAhAction temp = new BuyItemFromAhAction();
            Bots.
          * .Dynamic.DynamicProperty<int> Amount = new Bots.Professionbuddy.Dynamic.DynamicProperty<int>("1");
            //GoldEditor ge = new GoldEditor();
            BuyItemFromAhAction bifah = new BuyItemFromAhAction();
            var theList = Assembly.GetEntryAssembly().GetTypes().ToList().Where(t => t.Namespace != null && t.Namespace.Contains("Professionbuddy")).ToList();
            //XmlDocument doc = new XmlDocument();
            foreach (var v in theList)
            {
                Logging.Write(v.Namespace + " -> " + v.FullName);
            }*/
            //GroupGreeterSettings.Instance.Load();
            //greetedyet = false;
            
            /*
             * if (GroupGreeterSettings.Instance.gg_enable == false)
            {
                Logging.Write("[GroupGreet]: GroupGreeter is currently DISABLED!");
            }
            else
            {
                Logging.Write("[GroupGreet]: GroupGreeter is currently ENABLED!");
                Logging.Write("[GroupGreet]: Your greeting text is: \"" + GroupGreeterSettings.Instance.greeting1.ToString() + "\"!");
            }
            */
            Pulse();
        }


        public override void Pulse()
        {
            if (Me.IsAlive)
            {
              //  greetedyet = false;
                //BuyItemFromAh();
                //Logging.Write("[Desmo Auctioning Profile]: Logging Test");
            }
           // Greet();
           // TankMark();
        }
    }
}

